﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Main.Master" CodeBehind="MRPPOList.aspx.cs"
    Inherits="VSM.Parts.MRPPOList" EnableEventValidation="false" Title="Parts - Order Recommendation"%>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <h2>
                    &nbsp;<asp:Label ID="lblTitle" runat="server" Text="Parts - Order Recommendation"></asp:Label>
                </h2>
                <div style="margin-left: 5px; width: 99%;">
                    <hr />
                    <table id="Table1" width="100%" style="font-weight: bold">
                        <tr>
                            <td class="FormLineItem" style="width: 100px;">
                                Status
                            </td>
                            <td class="FormLineItem" valign="middle" style="width: 150px">
                                <asp:DropDownList ID="ddlStatus" runat="server" Width="100px" Height="20px">
                                    <asp:ListItem Value="A">All</asp:ListItem>
                                    <asp:ListItem Value="Open">Open</asp:ListItem>
                                    <asp:ListItem Value="Closed">Closed</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="FormLineItem" valign="middle">
                                Scenario Code:
                            </td>
                            <td class="FormLineItem" valign="middle">
                                <asp:DropDownList ID="ddlScenarioCode" runat="server" Width="100px" 
                                    Height="20px">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItemAlt" valign="middle">
                                From Doc. Date
                            </td>
                            <td class="FormLineItemAlt" valign="middle">
                                <asp:TextBox ID="txtFromDocDate" Width="100px" runat="server" Height="20px"></asp:TextBox>
                                <cc1:CalendarExtender ID="txtFromDocDate_CalendarExtender" runat="server" Format="dd/MM/yyyy"
                                    PopupButtonID="imgFromDocDate" TargetControlID="txtFromDocDate">
                                </cc1:CalendarExtender>
                                <asp:ImageButton ID="imgFromDocDate" runat="Server" AlternateText="Click to show calendar"
                                    ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                            <td class="FormLineItemAlt" valign="middle" style="width: 130px">
                                To Doc. Date
                            </td>
                            <td class="FormLineItemAlt" valign="middle">
                                <asp:TextBox ID="txtToDocDate" runat="server" Width="100px" Height="20px"></asp:TextBox>
                                <cc1:CalendarExtender ID="txtToDocDate_CalendarExtender" runat="server" Format="dd/MM/yyyy"
                                    PopupButtonID="imgToDocDate" TargetControlID="txtToDocDate">
                                </cc1:CalendarExtender>
                                <asp:ImageButton ID="imgToDocDate" runat="Server" AlternateText="Click to show calendar"
                                    ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItem" valign="middle">
                                From Due Date
                            </td>
                            <td class="FormLineItem" valign="middle">
                                <asp:TextBox ID="txtFromDueDate" runat="server" Width="100px" Height="20px"></asp:TextBox>
                                <cc1:CalendarExtender ID="txtFromDueDate_CalendarExtender" runat="server" Format="dd/MM/yyyy"
                                    PopupButtonID="imgFromDueDate" TargetControlID="txtFromDueDate">
                                </cc1:CalendarExtender>
                                <asp:ImageButton ID="imgFromDueDate" runat="Server" AlternateText="Click to show calendar"
                                    ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                            <td class="FormLineItem" valign="middle">
                                To Due Date
                            </td>
                            <td class="FormLineItem" valign="middle">
                                <asp:TextBox ID="txtToDueDate" runat="server" Width="100px" Height="20px"></asp:TextBox>
                                <cc1:CalendarExtender ID="txtToDueDate_CalendarExtender" runat="server" Format="dd/MM/yyyy"
                                    PopupButtonID="imgToDueDate" TargetControlID="txtToDueDate">
                                </cc1:CalendarExtender>
                                <asp:ImageButton ID="imgToDueDate" runat="Server" AlternateText="Click to show calendar"
                                    ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                        </tr>
                        <tr>
                            <td class="FormLineItemAlt" valign="middle">
                                From Doc. Total
                            </td>
                            <td class="FormLineItemAlt" valign="middle">
                                <asp:TextBox ID="txtFromDocTotal" OnKeyPress="return isNumberKey(this, event);" Style="text-align: right;"
                                    runat="server" Width="100px" Height="20px"></asp:TextBox>
                            </td>
                            <td class="FormLineItemAlt" valign="middle">
                                To Doc. Total
                            </td>
                            <td class="FormLineItemAlt" valign="middle">
                                <asp:TextBox ID="txtToDocTotal" OnKeyPress="return isNumberKey(this, event);" Style="text-align: right;"
                                    runat="server" Width="100px" Height="20px"></asp:TextBox>
                                <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" 
                                    Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat;" 
                                    Text="Search" Width="80px" />
                            </td>
                        </tr>
                    </table>
                    <hr />
                    <div style="width: 100%">
                        <asp:GridView ID="grdBP" runat="server" CssClass="GridInner" Width="100%" BorderColor="White"
                            BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                            HeaderStyle-Height="27px" OnSelectedIndexChanged="grdBP_SelectedIndexChanged"
                            OnRowDataBound="grdBP_RowDataBound">
                            <RowStyle BackColor="#D9E0ED" ForeColor="Black" BorderColor="White" BorderWidth="2px"
                                Height="25px" />
                            <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" Height="25px" />
                            <Columns>
                                <asp:TemplateField HeaderText="CardCode">
                                    <ItemStyle HorizontalAlign="Center" Width="2%" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblDocStatus" runat="server" Text='<%# Bind("CardCode") %>' BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="CardName">
                                    <ItemStyle HorizontalAlign="Left" Width="300px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblDocStatus" runat="server" Text='<%# Bind("CardName") %>' BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="PO Date">
                                    <ItemStyle HorizontalAlign="Center" Width="70px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblDocDate" runat="server" Text='<%# Bind("DocDate", "{0:dd/MM/yyyy}")%>'
                                            BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Due Date">
                                    <ItemStyle HorizontalAlign="Center" Width="70px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblDocDueDate" runat="server" Text='<%# Bind("DocDueLeadDate", "{0:dd/MM/yyyy}")%>'
                                            BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Model">
                                    <ItemStyle HorizontalAlign="Center"  Width="200px"/>
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblComments" runat="server" Text='<%# Bind("ModelName") %>' BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Product">
                                    <ItemStyle HorizontalAlign="Left" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblDocStatus" runat="server" Text='<%# Bind("ProductName") %>' BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Quantity">
                                    <ItemStyle HorizontalAlign="Right" />
                                    <HeaderStyle VerticalAlign="Middle" Width="15%" />
                                    <ItemTemplate>
                                        <asp:Label ID="txtDocTotal" runat="server" Text='<%#String.Format("{0,-15:#,##0.00}", Eval("Quantity"))%>'
                                            BorderStyle="none" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Status" Visible="false">
                                    <ItemStyle HorizontalAlign="Center" Width="2%" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblDocStatus" runat="server" Text='<%# Bind("Status") %>' BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="Remarks" >
                                    <ItemStyle HorizontalAlign="Left" Width="200px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblRemark" runat="server" Text='<%# Bind("Comments") %>' BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
                            <SelectedRowStyle BackColor="#3399ff" Font-Bold="true" ForeColor="Black" />
                            <HeaderStyle BackColor="#6095C9" ForeColor="#ffffff" Font-Overline="False"
                                Height="27px" VerticalAlign="Bottom" />
                            <EmptyDataTemplate>
                                <table class="GridInner" cellspacing="0" cellpadding="2" rules="all" border="1" id="ctl00_ContentPlaceHolder1_grdBP"
                                    style="background-color: White; border-color: White; width: 100%; border-collapse: collapse;">
                                    <tbody>
                                        <tr valign="bottom" style="color: White; background-color: #6095C9; 
                                            text-decoration: none; height: 27px;">
                                            <th valign="middle" scope="col">
                                                #
                                            </th>
                                            <th valign="middle" scope="col">
                                                CardCode
                                            </th>
                                            <th valign="middle" scope="col">
                                                CardName
                                            </th>
                                            <th valign="middle" scope="col">
                                                PO Date
                                            </th>
                                            <th valign="middle" scope="col">
                                                Due Date
                                            </th>
                                            <th valign="middle" scope="col">
                                                ItemCode
                                            </th>
                                            <th valign="middle" scope="col">
                                                Description
                                            </th>
                                            <th valign="middle" scope="col" style="width: 15%;">
                                                Quantity
                                            </th>
                                             <th valign="middle" scope="col" style="width: 15%;">
                                                Remarks
                                            </th>
                                        </tr>
                                        <tr >
                                            <td align="left" colspan="8">No Data Found</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </EmptyDataTemplate>
                        </asp:GridView>
                    </div>
                    <hr />
                    <table id="tblFooter" width="100%" style="font-weight: bold">
                        <tr>
                            <td>
                             <asp:Button ID="btnCreatePO" runat="server"  
                                    Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat;" 
                                    Text="Copy To PO" Width="80px" onclick="btnCreatePO_Click" />
                                <asp:Timer ID="Timer1" runat="server" Interval="1" OnTick="Timer1_Tick" />
                            </td>
                        </tr>
                    </table>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
